

export default{
	namespaced : true,
	state : ()=>({
		cartList : []
	}),
	mutations: {
		addToCart(state,goods){
			const res =  state.cartList.find(x=>x.goods_id === goods.goods_id)
			 if(!res){
				 state.cartList.push(goods)
			 }else{
				 res.goods_count ++
			 }
			console.log(state.cartList)
		}
	},
	
	getters : {
		total(state){
			state.cartList.
		}
	}
}